import unittest
import asyncio
import io
import sys
import contextlib
from camera import Camera  # 假设Camera类定义在camera.py中
from unittest.mock import patch
from queue import Queue


class TestCamera(unittest.IsolatedAsyncioTestCase):
    def setUp(self):
        self.camera = Camera()
        self.camera.__cap = True
        self.queue = Queue()

    async def test_open_camera(self):
        result = self.camera.open_camera1()
        self.assertTrue(result)

    async def test_gather_camera_img(self):
        result = self.camera.gather_camera_img1()
        self.assertTrue(result)


    async def test_close_camera(self):
        result = self.camera.open_camera1()
        self.assertTrue(result)


if __name__ == '__main__':
    unittest.main()
